<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AWTK-CPP: TCheckButton类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AWTK-CPP
   </div>
   <div id="projectbrief">AWTK CPP API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="class_t_check_button-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">TCheckButton类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="awtk__cpp_8hpp_source.html">awtk_cpp.hpp</a>&gt;</code></p>
<div class="dynheader">
类 TCheckButton 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_t_check_button.png" alt=""/>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:aea4349b7c6430a53a6e4c0ad044d2060"><td class="memItemLeft" align="right" valign="top"><a id="aea4349b7c6430a53a6e4c0ad044d2060"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>TCheckButton</b> (widget_t *nativeObj)</td></tr>
<tr class="separator:aea4349b7c6430a53a6e4c0ad044d2060"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1441a23a53926451cda5edec00546d6a"><td class="memItemLeft" align="right" valign="top"><a id="a1441a23a53926451cda5edec00546d6a"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>TCheckButton</b> (const check_button_t *nativeObj)</td></tr>
<tr class="separator:a1441a23a53926451cda5edec00546d6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeed1c6eb707683a621741db9edbe7ad5"><td class="memItemLeft" align="right" valign="top">ret_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_check_button.html#aeed1c6eb707683a621741db9edbe7ad5">SetValue</a> (bool value)</td></tr>
<tr class="separator:aeed1c6eb707683a621741db9edbe7ad5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f135df7f3817b373b1bfb9b273155ab"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_check_button.html#a0f135df7f3817b373b1bfb9b273155ab">GetValue</a> () const</td></tr>
<tr class="separator:a0f135df7f3817b373b1bfb9b273155ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:a25e0667ab9cf1f986cf9ab2ed15cabc8"><td class="memItemLeft" align="right" valign="top"><a id="a25e0667ab9cf1f986cf9ab2ed15cabc8"></a>
static <a class="el" href="class_t_check_button.html">TCheckButton</a>&#160;</td><td class="memItemRight" valign="bottom"><b>Cast</b> (widget_t *nativeObj)</td></tr>
<tr class="separator:a25e0667ab9cf1f986cf9ab2ed15cabc8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae701a764d674c53a8bb52cf12696c53c"><td class="memItemLeft" align="right" valign="top"><a id="ae701a764d674c53a8bb52cf12696c53c"></a>
static <a class="el" href="class_t_check_button.html">TCheckButton</a>&#160;</td><td class="memItemRight" valign="bottom"><b>Cast</b> (const widget_t *nativeObj)</td></tr>
<tr class="separator:ae701a764d674c53a8bb52cf12696c53c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a92cd23e079fdd47705fcfe063555af35"><td class="memItemLeft" align="right" valign="top"><a id="a92cd23e079fdd47705fcfe063555af35"></a>
static <a class="el" href="class_t_check_button.html">TCheckButton</a>&#160;</td><td class="memItemRight" valign="bottom"><b>Cast</b> (TWidget &amp;obj)</td></tr>
<tr class="separator:a92cd23e079fdd47705fcfe063555af35"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a709ca6cb018cdaae92625ec149eabcd9"><td class="memItemLeft" align="right" valign="top"><a id="a709ca6cb018cdaae92625ec149eabcd9"></a>
static <a class="el" href="class_t_check_button.html">TCheckButton</a>&#160;</td><td class="memItemRight" valign="bottom"><b>Cast</b> (const TWidget &amp;obj)</td></tr>
<tr class="separator:a709ca6cb018cdaae92625ec149eabcd9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c80ec512b87d529b1c8f48a1b7a39c8"><td class="memItemLeft" align="right" valign="top">static TWidget&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_check_button.html#a1c80ec512b87d529b1c8f48a1b7a39c8">Create</a> (TWidget &amp;parent, xy_t x, xy_t y, wh_t w, wh_t h)</td></tr>
<tr class="separator:a1c80ec512b87d529b1c8f48a1b7a39c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad93b7dd19ab1bf6bbb844a5d48082ed"><td class="memItemLeft" align="right" valign="top">static TWidget&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_check_button.html#aad93b7dd19ab1bf6bbb844a5d48082ed">CreateRadio</a> (TWidget &amp;parent, xy_t x, xy_t y, wh_t w, wh_t h)</td></tr>
<tr class="separator:aad93b7dd19ab1bf6bbb844a5d48082ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>勾选按钮控件(单选/多选)。</p>
<p>check_button_t是widget\_t的子类控件，widget_t的函数均适用于check_button_t控件。</p>
<p>在xml中使用"check_button"标签创建多选按钮控件。如：</p>
<div class="fragment"><div class="line">*&lt;<span class="keywordtype">check_button</span> <span class="keyword">name</span>=<span class="stringliteral">&quot;c1&quot;</span> <span class="keyword">text</span>=<span class="stringliteral">&quot;Book&quot;</span>/&gt;</div>
</div><!-- fragment --><p>在xml中使用"radio_button"标签创建单选按钮控件。如：</p>
<div class="fragment"><div class="line">*&lt;<span class="keywordtype">radio_button</span> <span class="keyword">name</span>=<span class="stringliteral">&quot;r1&quot;</span> <span class="keyword">text</span>=<span class="stringliteral">&quot;Book&quot;</span>/&gt;</div>
</div><!-- fragment --><blockquote class="doxtable">
<p>更多用法请参考： </p>
</blockquote>
<p><a href="https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/basic.xml">button.xml</a></p>
<p>在c代码中使用函数check_button_create创建多选按钮控件。如：</p>
<p>在c代码中使用函数check_button_create_radio创建单选按钮控件。如：</p>
<blockquote class="doxtable">
<p>完整示例请参考： </p>
</blockquote>
<p><a href="https://github.com/zlgopen/awtk-c-demos/blob/master/demos/check_button.c">button demo</a></p>
<p>可用通过style来设置控件的显示风格，如字体的大小和颜色等等。如：</p>
<div class="fragment"><div class="line">*&lt;<span class="keywordtype">style</span> <span class="keyword">name</span>=<span class="stringliteral">&quot;default&quot;</span> <span class="keyword">icon_at</span>=<span class="stringliteral">&quot;left&quot;</span>&gt;</div>
<div class="line">*&lt;<span class="keywordtype">normal</span>  <span class="keyword">icon</span>=<span class="stringliteral">&quot;unchecked&quot;</span> /&gt;</div>
<div class="line">*&lt;<span class="keywordtype">pressed</span> <span class="keyword">icon</span>=<span class="stringliteral">&quot;unchecked&quot;</span> /&gt;</div>
<div class="line">*&lt;<span class="keywordtype">over</span>    <span class="keyword">icon</span>=<span class="stringliteral">&quot;unchecked&quot;</span> <span class="keyword">text_color</span>=<span class="stringliteral">&quot;green&quot;</span>/&gt;</div>
<div class="line">*&lt;<span class="keywordtype">normal_of_checked</span> <span class="keyword">icon</span>=<span class="stringliteral">&quot;checked&quot;</span> <span class="keyword">text_color</span>=<span class="stringliteral">&quot;blue&quot;</span>/&gt;</div>
<div class="line">*&lt;<span class="keywordtype">pressed_of_checked</span> <span class="keyword">icon</span>=<span class="stringliteral">&quot;checked&quot;</span> <span class="keyword">text_color</span>=<span class="stringliteral">&quot;blue&quot;</span>/&gt;</div>
<div class="line">*&lt;<span class="keywordtype">over_of_checked</span> <span class="keyword">icon</span>=<span class="stringliteral">&quot;checked&quot;</span> <span class="keyword">text_color</span>=<span class="stringliteral">&quot;green&quot;</span>/&gt;</div>
<div class="line">*&lt;/<span class="keywordtype">style</span>&gt;</div>
</div><!-- fragment --><blockquote class="doxtable">
<p>更多用法请参考： </p>
</blockquote>
<p><a href="https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/styles/default.xml#L227">theme default</a> </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="a1c80ec512b87d529b1c8f48a1b7a39c8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1c80ec512b87d529b1c8f48a1b7a39c8">&#9670;&nbsp;</a></span>Create()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">TWidget TCheckButton::Create </td>
          <td>(</td>
          <td class="paramtype">TWidget &amp;&#160;</td>
          <td class="paramname"><em>parent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">xy_t&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">xy_t&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wh_t&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wh_t&#160;</td>
          <td class="paramname"><em>h</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>创建多选按钮对象</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">parent</td><td>父控件 </td></tr>
    <tr><td class="paramname">x</td><td>x坐标 </td></tr>
    <tr><td class="paramname">y</td><td>y坐标 </td></tr>
    <tr><td class="paramname">w</td><td>宽度 </td></tr>
    <tr><td class="paramname">h</td><td>高度</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对象。 </dd></dl>

</div>
</div>
<a id="aad93b7dd19ab1bf6bbb844a5d48082ed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aad93b7dd19ab1bf6bbb844a5d48082ed">&#9670;&nbsp;</a></span>CreateRadio()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">TWidget TCheckButton::CreateRadio </td>
          <td>(</td>
          <td class="paramtype">TWidget &amp;&#160;</td>
          <td class="paramname"><em>parent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">xy_t&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">xy_t&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wh_t&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wh_t&#160;</td>
          <td class="paramname"><em>h</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>创建单选按钮对象</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">parent</td><td>父控件 </td></tr>
    <tr><td class="paramname">x</td><td>x坐标 </td></tr>
    <tr><td class="paramname">y</td><td>y坐标 </td></tr>
    <tr><td class="paramname">w</td><td>宽度 </td></tr>
    <tr><td class="paramname">h</td><td>高度</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对象。 </dd></dl>

</div>
</div>
<a id="a0f135df7f3817b373b1bfb9b273155ab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0f135df7f3817b373b1bfb9b273155ab">&#9670;&nbsp;</a></span>GetValue()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool TCheckButton::GetValue </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>值。 </p>

</div>
</div>
<a id="aeed1c6eb707683a621741db9edbe7ad5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeed1c6eb707683a621741db9edbe7ad5">&#9670;&nbsp;</a></span>SetValue()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_t TCheckButton::SetValue </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>设置控件的值。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>值</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>output/<a class="el" href="awtk__cpp_8hpp_source.html">awtk_cpp.hpp</a></li>
<li>output/awtk_cpp.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
